#ifndef ANCHORHANDLE_H
#define ANCHORHANDLE_H


#include <QtGui>
#include "LibKanvas_global.h"

class ITool;

class LIBKANVAS_EXPORT AnchorHandle : public QGraphicsItem
{

public:

    AnchorHandle(int id = 0, ITool *parent = 0);
    ~AnchorHandle();

    void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);

    void mousePressEvent(QGraphicsSceneMouseEvent *event);
    void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
    void mouseMoveEvent(QGraphicsSceneMouseEvent *event);
    void hoverEnterEvent(QGraphicsSceneHoverEvent *event);
    void hoverLeaveEvent(QGraphicsSceneHoverEvent *event);
    QRectF boundingRect() const;

    int id() const {return _id;}

private:
    ITool * _parent;
    QPixmap _anchor;
    QCursor _currentCursor;
    int _id;

};

#endif // ANCHORHANDLE_H
